import React, { lazy, useEffect } from "react";
import { Routes, Route, Navigate, useLocation } from "react-router-dom";

import Home from "@container/home";
import Photowall from "@container/photoWall";

const routes = [
  { path: "/", component: <Navigate to={"/Home"} replace={true} /> },
  { path: "/home", component: <Home />, title: "首页" },
  { path: "/photowall", component: <Photowall />, title: "照片墙" },
];

export default () => {
  return (
    <Routes>
      {routes.map(({ path, component }) => (
        <Route exact key={path} path={path} element={component} />
      ))}
    </Routes>
  );
};
